package com.smart.manager.member.entities.models;

import com.smart.common.entities.core.BaseLongModel;
import com.smart.manager.member.entities.enums.PigCombineStatus;
import com.smart.manager.member.entities.views.MemberView;
import com.smart.manager.product.entities.views.PigLevelView;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;


/**
 * 猪仔管理  -- 合养的猪
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@Accessors(chain = true)
public class MemberMaterialCombinePig extends BaseLongModel {

    @ApiModelProperty("猪仔名称")
    private String name;

    @ApiModelProperty("合养代码")
    private String code;

    @ApiModelProperty("猪仔代码")
    private String codePig;

    @ApiModelProperty("猪仔详情")
    @ManyToOne
    @JoinColumn(name = "pig_level" , referencedColumnName = "id")
    private PigLevelView pigLevel;

    @ApiModelProperty("所属玩家")
    @ManyToOne
    @JoinColumn(name = "member" , referencedColumnName = "id")
    private MemberView member;

    @ApiModelProperty("邀请玩家")
    @ManyToOne
    @JoinColumn(name = "close_member" , referencedColumnName = "id")
    private MemberView closeMember;

    @ApiModelProperty("申请状态")
    private PigCombineStatus status;

}
